import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { BaseService } from './base.service';

@Injectable()
export class AuthenticationService extends BaseService {
    constructor(protected http: Http) {
        super();
    }

    get IsLoginIn() {
        return false;
    }

    async Login(userName: string, password: string) {
        let url = "manager/login";
        let r = await this.Post<any>(url, {
            loginName: userName,
            password: password
        });
        
        this.Token = r.token;
    }
}